﻿using System;
using System.Net;
using AccessControl.Contracts.Models;

namespace AccessControl.Data.Models
{
    /// <summary>
    /// Represents IP device in the system
    /// </summary>
    /// <remarks></remarks>
    public abstract class IpDevice : Model, IIpDevice
    {
        #region Fields

        IPAddress _Ip;
        int _PortNumber;

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the ip.
        /// </summary>
        /// <value>
        /// The ip.
        /// </value>
        public IPAddress Ip
        {
            get { return _Ip; }
            set
            {
                if (_Ip != value)
                {
                    _Ip = value;
                    NotifyPropertyChanged("Ip");
                }
            }
        }

        /// <summary>
        /// Gets or sets the port number.
        /// </summary>
        /// <value>
        /// The port number.
        /// </value>
        public int PortNumber
        {
            get { return _PortNumber; }
            set
            {
                if (_PortNumber != value)
                {
                    _PortNumber = value;
                    NotifyPropertyChanged("PortNumber");
                }
            }
        }

        #endregion
    }
}
